package com.itheima.mapper;

import com.itheima.bean.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface StudentMapper {
    /*
        学生持久层接口
    * */

    /*
        查询全部方法
    */
    @Select("SELECT * FROM student")
    public abstract List<Student> selectAll();
    /*添加学生的方法*/
    @Select("insert into student values (#{number},#{name},#{birthday},#{address})")
    void addStu(Student stu);
    /*更新学生的方法*/
    @Update("update student set number=#{number},name=#{name},birthday=#{birthday},address=#{address} where number=#{number}")
    void updateStu(Student stu);
    /*删除学生的方法*/
    @Delete("delete student from student where number=#{number}")
    void deleteStu(String number);
}
